import { request } from './request'

export function getOrgTree() {
  return request.get('/sys/org/orgTree')
}

export interface IUpsertOrgParams {
  id?: number
  masterId?: number
  masterName?: string
  orgName: string
  parentId: number
}

export function upsertOrg(params: IUpsertOrgParams) {
  return request.post('/sys/org/upsert', params)
}

export function getOrgDetail(id: string) {
  return request.get(`/sys/org/detail/${id}`)
}

export function deleteOrg(id: string) {
  return request.delete(`/sys/org/delete/${id}`)
}
